'Scroll Lock, Num Lock & Caps Lock keys are in use.
Declare Function GetKeyState% Lib "User" (ByVal nVirtKey%)
Const VK_CAPITAL = &H14
Const VK_NUMLOCK = &H90
Const VK_SCROLL = &H91
Sub Form_Load ()
txtKey.Text = "Use the API in the ""General Declarations"" section and the code in the Timer sub-routine to display Scroll, Num & Caps Lock status information. Although Microsoft provides a .VBX to accomplish this, it is more effective to display status information in this manner. You can also change foreground and background colors to give the appearance of an L.E.D. NOTE: It may be more benefical to use a seperate panel for each of the three keys."
End Sub
Sub Timer1_Timer ()
Dim Numlock%, Scrolllock%, Capslock%
Dim res$
Capslock% = GetKeyState%(VK_CAPITAL)
Numlock% = GetKeyState%(VK_NUMLOCK)
Scrolllock% = GetKeyState%(VK_SCROLL)
If Capslock% And 1 Then res$ = res$ + "CAPS ON "
If Numlock% And 1 Then res$ = res$ + "NUM ON "
If Scrolllock% And 1 Then res$ = res$ + "SCROLL ON"